package com.aaa.qy127.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class ExitController {

    /**
     * 退出登录，点击退出，把session删除 ，然后重定向到login.jsp 登录页面
     * @param request
     * @return
     */
    @RequestMapping("/exit")
    public String exit(HttpServletRequest request){
        HttpSession session = request.getSession();
        //session.invalidate();
        session.removeAttribute("staff");
        return "login";
    }

    /**
     * 退出登录，点击退出，把session删除 ，然后重定向到khdlogin.jsp 登录页面
     * @param request
     * @return
     */
    @RequestMapping("/tuichu")
    public String tuichu(HttpServletRequest request){
        HttpSession session = request.getSession();
        //session.invalidate();
        session.removeAttribute("dl");
        /*session.removeAttribute("dingdanxiangqing");
        session.removeAttribute("allGWC");*/
        return "khdlogin";
    }
}
